package com.haizhi.crm.common.constant;

import com.haizhi.crm.common.model.Status;

/**
 * Created by chengmo on 2018/5/17.
 */
public enum SysStatus implements Status {

    /**
     * 10000~19999
     * user             10000~11000
     * ...
     */
    USER_QUERY_ERROR(10001, "用户{0}查询异常" ),
    SAVE_POSITION_PERMISSION_ERROR(10002, "保存岗位{0}权限异常" ),
    DELETE_POSITION_PERMISSION_ERROR(10003, "删除岗位{0}权限异常" ),
    POSITION_NOT_EXISTS_PERMISSION_ERROR(100027, "岗位{0}没有权限异常" ),
    UPDATE_POSITION_PERMISSION_ERROR(10004, "修改岗位{0}权限异常" ),
    DETAIL_POSITION_PERMISSION_ERROR(10005, "查看岗位{0}权限详情异常" ),
    LIST_POSITION_PERMISSION_ERROR(10006, "查看岗位{0}权限列表异常" ),
    HAD_POSITION_PERMISSION_ERROR(10007, "岗位已经添加过权限，只能进行修改，不能再进行添加操作" ),
    FIND_POSITION_LIST_ERROR(10008, "查询岗位列表信息异常" ),
    FIND_RESOURCE_LIST_ERROR(10009, "查询资源列表信息异常" ),
    FIND_RELATION_LIST_ERROR(10010, "查询关系列表信息异常" ),
    SAVE_RELATION_PERMISSION_ERROR(10011, "保存关系权限信息异常" ),
    HAD_RELATION_PERMISSION_ERROR(10012, "关系已经添加过权限，只能进行修改，不能再进行添加操作" ),
    LIST_RELATION_PERMISSION_ERROR(10013, "查看关系权限列表异常" ),
    DETAIL_RELATION_PERMISSION_ERROR(10014, "查看关系权限详情异常" ),
    DELETE_RELATION_PERMISSION_ERROR(10015, "删除关系权限异常" ),
    RELATION_NOT_EXISTS_PERMISSION_ERROR(10018, "关系{0}没有权限异常" ),
    UPDATE_RELATION_PERMISSION_ERROR(10016, "更新关系权限异常" ),
    SYNC_POSITION_ERROR(10017, "同步岗位数据异常" ),
    SYNC_DEPARTMENT_ERROR(10018, "同步部门数据异常" ),
    SYNC_USER_ERROR(10019, "同步用户数据异常" ),
    SYNC_INSTITUTION_ERROR(10020, "同步机构数据异常" ),

    NAME_PASSWD_MISMATCH(10017, "用户名或密码错误" ),
    USER_NOT_LOGINED(10018, "用户未登录" ),
    USER_UNAUTH(-1, "用户未授权" ),
    USER_Id_NULL(10019, "不能获取当前用户ID" ),
    USER_NOTEXISTS(10020, "用户不存在" ),
    USER_LOGOUT_FAIL(10021, "用户登出失败" ),
    USER_RELOAD_PERMISSION_FAIL(10022, "用户重新加载权限失败" ),
    OLD_PASSWD_MISMATCH(10023, "原始密码错误" ),
    UPDATE_PASSWD_ERROR(10024, "修改密码失败" ),
    FIND_USERS_ERROR(10025, "查询用户异常" ),
    FILE_UPLOAD_ERROR(10026, "文件上次失败" ),
    CONFIRM_PWD_ERROR(10027, "确认用户密码异常" );
    private int code;
    private String desc;

    SysStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }
}
